package org.springblade.common.utils;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: TODO
 * @author syncwt
 * @date ${date} ${time}
 * @version V1.0
 */
public class CombineMapUtil {

	public static Map<String, BigDecimal> addTo(Map<String, BigDecimal> target, Map<String, BigDecimal> plus) {
		if (plus != null) {
			Object[] os = plus.keySet().toArray();
			String key;
			for (int i = 0; i < os.length; i++) {
				key = (String) os[i];
				if (target.containsKey(key)) {
					target.put(key, target.get(key).add(plus.get(key)));
				}else {
					target.put(key, plus.get(key));
				}
			}
		}

		return target;
	}
}
